<?php echo $this->fetch('pageheader.htm'); ?>
<div class="main-div">
<form method="post" action="role_action.php" name="theForm"  onsubmit="return validate()">
<table cellspacing="1" cellpadding="3" width="100%">
  <tr>
    <td class="label">模块名称</td>
    <td><input type="text" name="action_name" maxlength="60" size = "30" value="<?php echo htmlspecialchars($this->_var['action']['action_name']); ?>" /><span class="require-field">*</span></td>
  </tr>
    <tr>
    <td class="label">模块代码:</td>
    <td>
      <input type="text" name='action_code' maxlength="60" size = "30" value="<?php echo htmlspecialchars($this->_var['action']['action_code']); ?>"/><span class="require-field">*</span>
    </td>
  </tr>
  
      <tr>
    <td class="label">模块URL:</td>
    <td>
      <input type="text" name='action_url' maxlength="60" size = "30" value="<?php echo htmlspecialchars($this->_var['action']['action_url']); ?>"/><span class="require-field">*</span>
    </td>
  </tr>
  
  <tr>
    <td class="label">导航是否显示:</td>
    <td>
     <input type="radio" name="flag" value="1">显示
     <input type="radio" name="flag" value="0">不显示
    </td>
  </tr>
  <tr>
    <td class="label">上级模块</td>
    <td>
      <select name="parent_id" onchange="actionChanged()" <?php if ($this->_var['disabled']): ?>disabled="disabled"<?php endif; ?> >
        <option value="0">上级模块</option>
        <!--<?php $_from = $this->_var['action_select']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'action_list');if (count($_from)):
    foreach ($_from AS $this->_var['action_list']):
?>-->
         <option value="<?php echo $this->_var['action_list']['action_id']; ?>" <?php if ($this->_var['action_list']['action_id'] == $this->_var['action']['parent_id']): ?>selected<?php endif; ?>><?php echo $this->_var['action_list']['action_name']; ?></option>
        <!--<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>-->
      </select>
    </td>
  </tr>

  <tr>
    <td colspan="2" align="center"><br />
      <input type="submit" class="button" value="<?php echo $this->_var['button_value']; ?>" />
      <input type="reset" class="button" value="重置" />
      <input type="hidden" name="act" value="<?php echo $this->_var['form_action']; ?>" />
      <input type="hidden" name="id" value="<?php echo $this->_var['action']['action_id']; ?>" />
    </td>
  </tr>
</table>
</form>
</div>
<?php echo $this->smarty_insert_scripts(array('files'=>'../js/utils.js,validator.js')); ?>

<script language="JavaScript">
<!--
/**
 * 检查表单输入的数据
 */
function validate()
{
    validator = new Validator("theForm");
    validator.required("action_name",  '没有输入模块的名称!');
	validator.required("action_code",  '没有输入模块的代码!');
	validator.required("action_url",  '没有输入模块的URL!');
    return validator.passed();
}

//-->
</script>

<?php echo $this->fetch('pagefooter.htm'); ?>